package f_facade.b_design_pattern;

/**
 * Created by wug on 2016/7/1 0001.
 */
public class FacadeRobot {
    private String name = "机器人管家";
    private Electricity electricity;
    private Car car = new Car();
    private Router router = new Router();
    private KitchenAirCondition kitchenAirCondition = new KitchenAirCondition();
    private LivingRoomAirCondition livingRoomAirCondition = new LivingRoomAirCondition();


    public void goHome() {

        System.out.println("~~~~~~~~~~机器人管家开始工作~~~~~~~~");

        car.lockTurn2ACC();
        car.openOutsideLoop();
        System.out.println(name + "3分钟后");
        car.closeOutsideLoop();
        car.openAirConditioning();

        electricity = new Electricity();
        electricity.setOn(true);
        router.powOn(electricity);
        router.downloadNewestMovie();

        kitchenAirCondition.powOn(electricity);
        kitchenAirCondition.run();

        livingRoomAirCondition.powOn(electricity);
        livingRoomAirCondition.run();

        System.out.println("~~~~~~~~~~机器人管家结束工作~~~~~~~~");
    }

    public Electricity getElectricity() {
        return electricity;
    }

    public Car getCar() {
        return car;
    }

    public Router getRouter() {
        return router;
    }

    public KitchenAirCondition getKitchenAirCondition() {
        return kitchenAirCondition;
    }

    public LivingRoomAirCondition getLivingRoomAirCondition() {
        return livingRoomAirCondition;
    }
}
